﻿using System;
using System.Text;
using Nb.Common.Encrypt;

namespace Nb.Common.MachineCodes
{
    //读取机器码信息组件
    /// <summary>
    /// 读取机器码信息组件（支持运行时替换）
    /// </summary>
    public class MachineCodeFacade
    {
        /// <summary>
        /// 读取机器码信息
        /// </summary>
        public static string ReadCode()
        {
            var machineCodeService = MachineCodeServiceRegistry.Instance.GetService();
            var code = machineCodeService.ReadCode();

            string logMessage = string.Format("read machine code => {0}", code);
            Log(logMessage);

            return code;
        }

        private static void Log(string message)
        {
            UtilsLogger.LogMessage(message);
        }
    }
}
